home *** CD-ROM | disk | FTP | other *** search
/ PC Answers 2002 January / PC Answers January 2002.7z / PC Answers January 2002.bin / graphics / freepixl / _SETUP.1 / accessinet.pxl < prev    next >
Text File  |  2001-08-22  |  5KB  |  213 lines

  1. {    Filename    :     accessint.pxl
  2.      Purpose    :    <purpose>
  3.     Date        :    January 5, 2000
  4.     Author        :    <author name (optional: company)>
  5. History:
  6.  
  7.     Version    :  4.40    RELEASE
  8.     Update        :  
  9.     Date        :  
  10.  
  11. --------------------------------------------------------------------------}
  12. Initialize: {only one instance allowed}
  13.     UseCoordinates(PIXEL)
  14.     Title$ = "PiXCL Test Application"                                  
  15.     WinExist(Title$,Res)
  16.     If Res = 0 Then Goto One_Instance
  17.     Beep
  18.     WinSetActive(Title$,Res)
  19.     WinShow(Title$,RESTORE,Res)
  20.     End
  21. One_Instance:
  22.     UseCaption(Title$) {change the title}
  23.     WinLocate(Title$,734,80,1270,664,Res)                
  24.     UseBackground(TRANSPARENT,0,128,192)     
  25.     WinShow(Title$,TOPMOST,Res) 
  26.     DrawBackGround
  27.     DirGet(SourceDir$) {used later for library function calls}
  28.  
  29.     DragAcceptFile(ENABLE,AcceptFile)
  30.     AutoProgressBar(DISABLE)
  31.  
  32.     InfoMenu(REMOVE)
  33.     WaitInput(100)
  34.     SetMenu("&File",IGNORE,
  35.         "&New",CreatingFile,
  36.         "&Open",OpeningFile,
  37.         "&Save",SavingFile,
  38.         SEPARATOR,
  39.         "E&xit!",Terminate,
  40.         ENDPOPUP,
  41.         "&View",IGNORE,
  42.         "&ToolBar",ViewToolBar,
  43.         "&StatusBar",ViewStatusBar,
  44.         ENDPOPUP,
  45.         "&Information",IGNORE,
  46.         "&Concept",Concept,
  47.         "&Help",ShowAppHelp,
  48.         SEPARATOR,
  49.         "&About",About,
  50.         ENDPOPUP)
  51.  
  52.     GoSub MakeToolbar
  53.     ChangeMenuItem("&ToolBar",CHECK,TBRes)
  54.  
  55.         
  56.     StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  57.     DrawStatusWinText(0,"Ready")
  58.     ChangeMenuItem("&StatusBar",CHECK,SBRes)
  59.  
  60.     
  61. Wait_for_Input:
  62.     WaitInput()
  63.  
  64. Terminate:
  65.     End
  66.  
  67.  
  68. Concept:
  69.     MessageBox(OK,1,INFORMATION,
  70. "This is a skeleton of a PiXCL application.  You could briefly
  71. describe your application's function here, or provide some
  72. basic help information.",
  73.     "PiXCL Skeleton Concept",Res)
  74.  
  75.     Goto Wait_for_Input
  76.  
  77. ShowAppHelp:
  78.     {An application Help file usually has the same name as the application.}
  79.     Winhelp("a.hlp",CONTENTS,"")
  80.  
  81.     Goto Wait_for_Input
  82.  
  83. About:
  84.     AboutUser("PiXCL Application Title",  { or substitute Title$}
  85.       "Two lines of text goes here e.g. Application function.",
  86.     "Four Lines of additional information goes here, perhaps contact information and Web addresses")   
  87.  
  88.     Goto Wait_for_Input
  89.  
  90. ViewToolBar:
  91.     GetMenuStatus("&ToolBar",CHECKED,Res)
  92.     If Res = 0
  93.         GoSub MakeToolbar
  94.         ChangeMenuItem("&ToolBar",CHECK,Res)
  95.     Else
  96.         Toolbar()
  97.         ChangeMenuItem("&ToolBar",UNCHECK,Res)
  98.     Endif
  99.     Goto Wait_for_Input
  100.  
  101. ViewStatusBar:
  102.     GetMenuStatus("&StatusBar",CHECKED, Res)
  103.     If Res = 0
  104.         StatusWindow(ENABLE,BOTTOM,2,200,-1,0,0)
  105.         DrawStatusWinText(0,"Ready")
  106.         ChangeMenuItem("&StatusBar",CHECK,Res)
  107.     Else
  108.         StatusWindow(DISABLE,BOTTOM,2,200,-1,0,0)
  109.        ChangeMenuItem("&StatusBar",UNCHECK,Res)
  110.     Endif
  111.     Goto Wait_for_Input
  112.  
  113. CreatingFile:
  114.     WaitInput(1)
  115.     Goto Wait_for_Input
  116.  
  117. OpeningFile:
  118.     WaitInput(1)
  119.     image$ = SourceDir$ + "\1iddnext.bmp"
  120.     Drawbitmap(20,40,image$)
  121.     Goto Wait_for_Input
  122.  
  123. SavingFile:
  124.     WaitInput(1)
  125.     Goto Wait_for_Input
  126.  
  127. PrintingFile:
  128.     WaitInput(1)
  129.     IPAddressBox(100,100,300,130,Res)
  130.     Button(310,100,400,130,PUSH,"IP Done",GettingIPAddress)
  131.     Goto Wait_for_Input
  132.  
  133. GettingIPAddress:
  134.     GetIPAddress(P,A,B,C,D)
  135.     IPAddressBox(0,0,0,0,Res)
  136.     Button()
  137.     DrawBackground
  138.     DrawNumber(10,40,A) DrawNumber(50,40,B) DrawNumber(90,40,C) DrawNumber(130,40,D)
  139.     NumToHex(P,P$)
  140.     DrawText(10,60,P$) 
  141.     Goto Wait_for_Input
  142.  
  143.  
  144. HelperList1:
  145.     WaitInput(1)
  146.  
  147.  
  148.     URL$ = "http://www.vysor.com"
  149.     InetCheckConnection(URL$,Res)
  150.     DebugMsgBox(Res)
  151.  
  152.  
  153. {    InetAutodial(USERONLINE,Res)
  154.     
  155.     DebugMsgBox("Ready?") 
  156.  
  157.     InetGoOnline("http://www.vysor.com",Res)
  158.     { runs the Dialup Connection applet, does not invoke the browser.}
  159.  
  160.     DebugMsgBox(Res)
  161. }
  162.  
  163.     Goto Wait_for_Input
  164.  
  165. HelperList2:
  166.     WaitInput(1)
  167.     DrawBackground
  168.     InetAutodialHangup(Res)
  169.     DebugMsgBox(Res)
  170.     Goto Wait_for_Input
  171.  
  172.  
  173. HelperList3:
  174.     WaitInput(1)
  175.     DrawBackground
  176.     InetSetDialState("Synapse Internet",Res)
  177.     InetDial(USERONLINE,"Synapse Internet",Connection)
  178.     DebugMsgBox(Connection) 
  179.  
  180.     Goto Wait_for_Input
  181.  
  182.  
  183.  
  184. HelperList4:
  185.     WaitInput(1)
  186.     DrawBackground
  187.     InetHangup(Connection,Res)
  188.     Goto Wait_for_Input
  189.  
  190.  
  191. AcceptFile:
  192.     GetDragList(FileList$)
  193.     {TODO: add file list handling here, or delete this whole label handler}
  194.     Goto Wait_for_Input
  195.     
  196. {--- Style Suggestion: place all subroutines at the end of the script.}
  197.  
  198. MakeToolbar: {subroutine}
  199.     Toolbar(RAISED, PXL_LARGE,
  200.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  201.         PXL_NEW, ENABLED, STD, "Create File", CreatingFile,
  202.         PXL_OPEN, ENABLED, STD, "Open File", OpeningFile, 
  203.         PXL_SAVE, ENABLED, STD, "Save File", SavingFile, 
  204.         PXL_PRINT,  ENABLED, STD,"IP Address Box", PrintingFile, 
  205.         HELPER_1,  ENABLED, STD,"Inet Autodial", HelperList1,
  206.         HELPER_2,  ENABLED, STD,"Autodial hangup", HelperList2,
  207.         HELPER_3,  ENABLED, STD,"Inet Dial", HelperList3,
  208.         HELPER_4,  ENABLED, STD,"Hangup", HelperList4,
  209.         NULL, NULL, SEPARATOR, "", Wait_for_Input, 
  210.         HELPINFO, ENABLED, STD,"Show Help",ShowAppHelp) 
  211.  
  212.     Return
  213.